package lsf.itcast.service.imp;

import com.github.pagehelper.PageHelper;
import lsf.itcast.dao.ProductDao;
import lsf.itcast.domain.Product;
import lsf.itcast.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ProductServiceImp implements ProductService {

    @Autowired
    private ProductDao productDao;
    @Override
    public List<Product> findAllProdunct(int page,int pageSize) {
        PageHelper.startPage(page,pageSize);
        return productDao.findAllProdunct();
    }

    @Override
    public void saveProduct(Product product) {
        productDao.saveProduct(product);
    }
}
